<template>
  <div id="playbox">
    <div class="musicInfo" @click="toSong">
      <div class="img">
        <img :src="mpic" alt="" />
      </div>
      <div class="introduce">
        <p class="title">{{mname}}</p>
        <span>{{author}}</span>
      </div>
    </div>
    <audio :src="murl" controls="controls" autoplay loop></audio>

    <i
      class="el-icon-s-fold"
      @click="drawer = true"
      style="font-size: 30px"
    ></i>

    <el-drawer
      title="我是标题"
      :visible.sync="drawer"
      :with-header="false"
      :append-to-body="false"
      :modal="false"
      size="400px"
    >
      <span>我来啦!</span>
    </el-drawer>
  </div>
</template>

<script>
export default {
  data() {
    return {
      drawer: false,

    };
    
  },
  methods:{
    toSong(){
      this.$router.push({name:'playSong'})
    }
  },
  props:['murl','mpic','mname','author']
};
</script>

<style scoped>
#playbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  height: 80px;
  border-top: 1px solid #ccc;
}
.img img {
  width: 60px;
  height: 60px;
  background-color: yellow;
  border-radius: 5px;
}
.musicInfo {
  display: flex;
}
.introduce {
  padding: 10px;
}
audio{
    width: 500px;
}
</style>